package cn.lili.controller.store;

import cn.lili.common.enums.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.store.entity.dto.StoreInfoListDTO;
import cn.lili.modules.store.entity.vos.StoreInfoVO;
import cn.lili.modules.store.service.StoreInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 买家端,店铺接口
 *
 * @author Bulbasaur
 * @since 2020/11/17 2:32 下午
 */
@RestController
@RequestMapping("/buyer/storeInfo")
@Api(tags = "买家端,门店接口")
public class StoreInfoBuyerController {

    /**
     * 门店是Service
     */
    @Autowired
    private StoreInfoService storeInfoService;


    @ApiOperation(value = "获取门店列表，并根据坐标标记最近的门店")
    @GetMapping
    public ResultMessage <List <StoreInfoVO>> getByLocation(StoreInfoListDTO dto) {
        return ResultUtil.data(storeInfoService.getByLocation(dto));
    }


}
